# coding: utf-8
from sqlalchemy import Column, String, TIMESTAMP, Table, Text, text, MetaData
from sqlalchemy.dialects.mysql import ENUM, INTEGER, LONGTEXT, MEDIUMINT, MEDIUMTEXT, TEXT, TINYINT, VARCHAR
from ..database import db,serialize


class Group(db.Model):
    __tablename__ = 'groups'

    id = Column(INTEGER(10), primary_key=True)
    name = Column(String(30, 'utf8mb4_unicode_ci'), nullable=False, comment='用户组名')
    points = Column(INTEGER(11), nullable=False, server_default=text("'1000'"), comment='所需积分')
    discount = Column(INTEGER(11), nullable=False, server_default=text("'100'"), comment='折扣')
    status = Column(TINYINT(4), nullable=False, server_default=text("'1'"), comment='状态，1正常0禁用')
    created_at = Column(TIMESTAMP)
    updated_at = Column(TIMESTAMP)